package com.cqjtu.graduation.entity;

import java.util.Objects;

/**
 * 用户实体类，用来对应数据库的user表
 * @author yhl
 */
public class UserDO extends BaseDO {
    private String userId;
    private String userPassword;
    private String userName;
    private RoleDO roleDO;//用户的具体身份
    private String userPhotoPath;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserPassword() {
        return userPassword;
    }

    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public RoleDO getRoleDO() {
        return roleDO;
    }

    public void setRoleDO(RoleDO roleDO) {
        this.roleDO = roleDO;
    }

    public String getUserPhotoPath() {
        return userPhotoPath;
    }

    public void setUserPhotoPath(String userPhotoPath) {
        this.userPhotoPath = userPhotoPath;
    }
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserDO userDO = (UserDO) o;
        return userId.equals(userDO.userId) &&
                userPassword.equals(userDO.userPassword) &&
                userName.equals(userDO.userName) &&
                roleDO.equals(userDO.roleDO) &&
                userPhotoPath.equals(userDO.userPhotoPath);
    }

    @Override
    public int hashCode() {
        return Objects.hash(userId, userPassword, userName, roleDO, userPhotoPath);
    }

    @Override
    public String toString() {
        return "UserDO{" +
                "userId='" + userId + '\'' +
                ", userPassword='" + userPassword + '\'' +
                ", userName='" + userName + '\'' +
                ", roleDO=" + roleDO +
                ", userPhotoPath='" + userPhotoPath + '\'' +
                '}';
    }
}
